﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace PSE.Framework.UI.Controls.SmartClient
{
    /// <summary>
    /// Handler do evento disparado quando a célula corrente muda
    /// </summary>
    /// <param name="sender">Objeto que disparou o evento</param>
    /// <param name="e">Parâmetros do evento</param>
    public delegate void CurrentCellChangedHandler(object sender, CurrentCellChangedEventArgs e);

    /// <summary>
    /// Parâmetros do evento disparado quando a célula corrente muda
    /// </summary>
    public class CurrentCellChangedEventArgs : ItemEventArgs
    {
        #region Construtores
        /// <summary>
        /// Construtor padrão
        /// </summary>
        public CurrentCellChangedEventArgs()
            : base()
        {
        }

        /// <summary>
        /// Construtor que inicializa RoutedEvent
        /// </summary>
        /// <param name="routedEvent">RoutedEvent</param>
        public CurrentCellChangedEventArgs(RoutedEvent routedEvent)
            : base(routedEvent)
        {
        }

        /// <summary>
        /// Construtor que inicializa RoutedEvent e Source
        /// </summary>
        /// <param name="routedEvent">RoutedEvent</param>
        /// <param name="source">Source</param>
        public CurrentCellChangedEventArgs(RoutedEvent routedEvent, object source)
            : base(routedEvent, source)
        {
        }

        /// <summary>
        /// Construtor que inicializa RoutedEvent, Source, e ItemInfo
        /// </summary>
        /// <param name="routedEvent">RoutedEvent</param>
        /// <param name="source">Source</param>
        /// <param name="itemInfo">Informações sobre o item</param>
        public CurrentCellChangedEventArgs(RoutedEvent routedEvent, object source, ItemInfo itemInfo)
            : base(routedEvent, source, itemInfo)
        {
        }

        /// <summary>
        /// Construtor que inicializa RoutedEvent, Source, ItemInfo, OldCell e NewCell
        /// </summary>
        /// <param name="routedEvent">RoutedEvent</param>
        /// <param name="source">Source</param>
        /// <param name="itemInfo">Informações sobre o item</param>
        /// <param name="oldCell">Célula antiga</param>
        /// <param name="newCell">Célula atual</param>
        public CurrentCellChangedEventArgs(RoutedEvent routedEvent, object source, ItemInfo itemInfo, BaseCell oldCell, BaseCell newCell)
            : this(routedEvent, source, itemInfo)
        {
            _oldCell = oldCell;
            _newCell = newCell;
        }
        #endregion

        #region Propriedades
        private BaseCell _oldCell = null;
        /// <summary>
        /// Célula antiga
        /// </summary>
        public BaseCell OldCell
        {
            get { return _oldCell; }
        }

        private BaseCell _newCell = null;
        /// <summary>
        /// Célula atual
        /// </summary>
        public BaseCell NewCell
        {
            get { return _newCell; }
        }
        #endregion

   }
}
